{template header}
<script language="javascript" type="text/javascript">
		J(function(){
		
			bopuruiObj.command.webTitle('我的购物车');
		
			J('#theform').submit(function(){
				if(J('input[name=logisticId]:checked').length==0){
					alert('你至少需要选择一种配送方式 ！');
					return false;
				}
				if(J('input[name=payType]:checked').length==0){
					alert('你至少需要选择一种支付方式！');
					return false;
				} else {
					var totalPrice = '{$CartArr[totalPrice]}';
					var limitamount = '{$limitamount}';
					if(parseFloat(totalPrice) > parseFloat(limitamount) && J('input[name=payType]:checked').attr('value')==1) {
						alert('总金额超过'+limitamount+'元，请选择银行汇款/转帐');
						return false;
					}
				}
			});
			
			J('#DistributionSubmit').bind('click', function(){	
				if(J.trim(J('input[id=realName]').val())==''){
					J('input[id=realName]').focus();
					return false;
				}
				
				if(J.trim(J('input[id=email]').val())==''){
					alert('请填写电子邮件地址');
					J('input[id=email]').focus();
					return false;
				}else{
					var reg=/[-.\w]+\@[-A-Za-z0-9]+\.[A-Za-z\.]{2,}$/i;
					if(!reg.test(J('input[id=email]').val())){
						alert('E-mail格式不对!');
						J('input[id=email]').focus();
						return false;
					}
				}
				
				if(J.trim(J('input[id=address]').val())==''){
					alert('请填写详细地址');
					J('input[id=address]').focus();
					return false;
				}
				if(J.trim(J('input[id=phone]').val())==''){
					alert('请填写电话');
					J('input[id=phone]').focus();
					return false;
				}
						
				J.ajax({
					type: "POST",
					url: 'cart-consignee.htm?action=distributionUpdate&id={$info[id]}',
					data: J('#theform').serialize(),
					cache: false,
					dataType: 'json',
					beforeSend: function(){
						J('#DistributionSubmit').attr('disabled','disabled');
						J('#loaddingImg').html('<img src="{GODHOUSE_DOMAIN_IMAGE}images/common/loading.gif" width="18" height="18" />');
						J('#loaddingText').html('请稍后，正在处理...');
					},
					success: function(data){
						if(data['state']==1) {							
							J('#ConsigneeInfo span').each(function(){
								if(J(this).attr('id')=='area') {	
									var province = J(this).children().eq(0).find("option:selected").text();
									var area = J(this).children().eq(1).find("option:selected").text();
									J('#areaInfo').html(J(this).html());
									J(this).html(area + '->' + province);
								}else{
									J(this).html(J(this).children().val());
								}
							});
							
							J('#consigneeId').val(data['insertId']);
							J('#DistributionSubmit').attr('disabled','');
							J('#loaddingImg').html('');
							J('#loaddingText').html('');
							J('#displaySubmit').hide();
						}
					}
				});
			});
			
			J('#consigneeEdit').bind('click', function(){
				var areaInfo = J('#areaInfo').html();
				if(J.trim(areaInfo)!=''){
					J('#ConsigneeInfo span').each(function(){
						if(J(this).attr('id')=='area') {						
							J('#areaInfo').empty();
							J(this).html(areaInfo);
							J('#province').val(J(this).attr('province')).change();
						}else{
							J(this).html('<input class=inputbg '+(J(this).attr('id')=='address' ? 'style="width:260px;"' : '' )+' name=info['+J(this).attr('id')+'] id="'+J(this).attr('id')+'" value="'+J(this).html()+'">');
						}
					});
					J('#displaySubmit').show();
				}
			});
		})
	</script>


	<style type="text/css">
.boldTitle{float:left; font-size:14px; font-weight:bold; padding:5px;}
.inputbg{width:180px; border:1px solid #999999; padding:2px;}
</style>
<div class="top_1"></div>
<div class="top_2">
	<div class="con_left">
		{template userlogin}
	</div>
	<div class="con_box_left">
		<form id=theform name=theform action="" method="post">		
			<div style="border-top:2px #009900 solid">
				<span class="boldTitle">商品列表</span>
				<a style="float:right; font-weight:bold; color:#0033CC" href="/cart.htm">修改</a>
			</div>		
			<table class=floattable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0 style="font-family:Arial, Helvetica, sans-serif">
				<tbody>
					<tr>
						<th width="13%" height="30" align="center" bgcolor=#ffffff>订货号</th>
						<th width="21%" height="22" align="center" bgcolor=#ffffff>产品说明</th>
						<th width="17%" height="22" align="center" bgcolor=#ffffff>市场价格   </th>
						<th width="14%" height="22" align="center" bgcolor=#ffffff>会员价格</th>
						<th width="13%" height="22" align="center" bgcolor=#ffffff>小计</th>
						<th width="11%" align="center" bgcolor=#ffffff>优惠</th>
						<th width="11%" align="center" bgcolor=#ffffff>数量</th>
					</tr>
					<!--{loop $CartArr[shopCartArr] $list}-->
					<tr>
					  <td height="28" align="center" bgcolor=#ffffff><input name="cartId[]" type="hidden" value="{$list[cartId]}" /><!--{$list[promotions]}-->{$list[productNo]} </td>
						<td align="center" bgcolor=#ffffff>
						<a class='alt' href="#" _fcksavedurl="#"><span>{$list[content]}</span><font class="ari" >{$list[contents]}</font></a>						</td>
						<td align=right bgcolor=#ffffff style="padding-right:25px;"><font class="scj">$list[ourPrice]</font></td>
						<td align=right bgcolor=#ffffff style="padding-right:25px;" class="hyj">$list[userPrice]</td>
						<td align=right bgcolor=#ffffff style="padding-right:15px;"><font class="scj">$list[totalPrice]</font></td>
						<td align=right bgcolor=#ffffff style="padding-right:15px;"><font class="scj">$list[offerPrice]</font></td>
						<td align=center bgcolor=#ffffff class=price>$list[cartCount]</td>
					</tr>
					<!--{/loop}-->
					<tr>
						<td height="30" colspan=8 bgcolor=#ffffff style="font-size:14px; color:#FE6500; padding-left:10px; font-weight:bold">购物金额小计￥{$CartArr[totalPrice]}元</td>
					</tr>
				</tbody>
		  </table>
			
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">收货人信息</span>
				<a style="float:right; font-weight:bold; color:#0033CC" href="#1" id="consigneeEdit">修改</a>
			</div>
			<div id="areaInfo" style="display:none">
				<select name="info[province]" id="province" style="width: 110px;" onchange="ajaxget('site-ajaxCity-'+this.value+'.htm', 'showCity', 'showCity', null, function(){J('#city').val(J('#area').attr('city'))})">
					<option value="">请选择区域</option>
					<!--{loop $areaList $v}-->
					<option value="{$v[id]}" {if $area[fId]==$v[id]}selected="selected"{/if}>{$v[name]}</option>
					<!--{/loop}-->
				</select>
				<label id="showCity">
				<select name="info[city]" id="city" style="width: 110px;">
					<option value="">请选择区域</option>
				</select>
				</label>
				<label style="color:red" id="err_city"></label>

			</div>
			<table cellspacing=1 cellpadding=5 width="99%" align=center bgcolor=#dddddd border=0 id="ConsigneeInfo">
				<tbody>
					<tr>
					  <td width="14%" align="right" bgcolor=#ffffff>地区：</td>
					  <td bgcolor=#ffffff><span id="area" province="{$info[province]}" city="{$info[city]}">{$info[cityInfo]}</span></td>
					  <td width="15%" align="right" bgcolor="#ffffff">电子邮件地址：</td>
					  <td width="37%" bgcolor="#ffffff"><span id="email">{$info[email]}</span></td>
				  </tr>
					<tr>
						<td align="right" bgcolor=#ffffff>收货人姓名：</td>
						<td width="34%" bgcolor=#ffffff><span id="realName">{$info[realName]}</span></td>
						<td align="right" bgcolor="#ffffff">邮政编码：</td>
						<td bgcolor="#ffffff"><span id="zipcode">{$info[zipcode]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>详细地址：</td>
						<td bgcolor=#ffffff><span id="address">{$info[address]}</span></td>
						<td align="right" bgcolor="#ffffff">手机：</td>
						<td bgcolor="#ffffff"><span id="mobile">{$info[mobile]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>电话：</td>
						<td bgcolor=#ffffff><span id="phone">{$info[phone]}</span></td>
						<td align="right" bgcolor="#ffffff">最佳送货时间：</td>
						<td bgcolor="#ffffff"><span id="bestTime">{$info[bestTime]}</span></td>
					</tr>
					<tr>
						<td align="right" bgcolor=#ffffff>标志建筑：</td>
						<td bgcolor=#ffffff><span id="signBuilding">{$info[signBuilding]}</span></td>
						<td align="right" bgcolor=#ffffff>&nbsp;</td>
						<td bgcolor=#ffffff>&nbsp;</td>
					</tr>
					<tr id="displaySubmit" style="display:none">
					  <td align=center bgcolor=#ffffff colspan=4>
						  <table width="100%" border="0" cellpadding="0" cellspacing="0">
							  <tr>
								<td width="51%" align="right"><input type=button value=配送至这个地址 name=submit id="DistributionSubmit"></td>
								  <td width="2%" align="left" style="padding-left:2px; padding-right:2px;" id="loaddingImg"></td>
								  <td width="47%" style="text-align:left"><label style="color:red" id="loaddingText"></label></td>
							  </tr>
						  </table>						  
					  </td>
					</tr>
				</tbody>
		  </table>
			  
		  
			  
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">配送方式</span>
		  </div>
			<table class=floattable id=shippingtable cellspacing=1 cellpadding=3 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<th width="5%" height="30" bgcolor=#ffffff>&nbsp;</th>
						<th width="18%" bgcolor=#ffffff>名称</th>
						<th width="77%" bgcolor=#ffffff>订购描述</th>
					</tr>
					<!--{loop $logisticArr $list}-->
					<tr>
					  <td height="30" align="center" bgcolor=#ffffff><input type=radio value="{$list[logisticId]}" name="logisticId"></td>
						<td align="center" bgcolor=#ffffff><strong>{$list[title]}</strong></td>
						<td bgcolor=#ffffff>{$list[content]}</td>
					</tr>
					<!--{/loop}-->
				</tbody>
		  </table>
			
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">支付方式(<font style="font-weight:normal; font-size:12px;">总金额如果超过{GODHOUSE_PAY_LIMITAMOUNT}元，请选择使用银行汇款/转帐</font>)</span>
			</div>
			<table class=floattable id=paymenttable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<th width="5%" bgcolor=#ffffff>&nbsp;</th>
						<th width="21%" bgcolor=#ffffff>名称</th>
						<th width="56%" bgcolor=#ffffff>订购描述</th>
						<th width="18%" bgcolor=#ffffff>手续费</th>
					</tr>
					<tr>
					  <td height="12" align="center" bgcolor=#ffffff><input type=radio value="{GODHOUSE_PAY_TYPE_NETWORK}" name="payType"></td>
						<td bgcolor=#ffffff><strong>支付宝</strong></td>
						<td bgcolor=#ffffff> 支付宝网站(www.alipay.com) 是国内先进的网上支付平台。</td>
						<td align=right bgcolor=#ffffff class=f1>费率以支付宝为准</td>
					</tr>
					<tr>
					  <td height="35" bgcolor=#ffffff>&nbsp;</td>
			          <td height="35" colspan="3" bgcolor=#ffffff><strong>如产品总额超过{GODHOUSE_PAY_LIMITAMOUNT}元,请选择银行汇款支付！</strong></td>
		          </tr>
					<tr>
					  <td align="center" valign=top bgcolor=#ffffff><input type=radio value="{GODHOUSE_PAY_TYPE_BANK}" name="payType" iscod="0"></td>
						<td valign=top bgcolor=#ffffff><strong>银行汇款/转帐</strong></td>
						<td valign=top bgcolor=#ffffff  style="line-height:23px;"><strong>公司: </strong>波普瑞(北京)科技有限公司<br />
						  <strong>开户行:</strong>华夏银行北京望京支行<br />
						  <strong>帐号: </strong>1028 0000 0004 11629<br />
						  <strong>税号: </strong>1101 0556 9521 898<br />
						  <strong>地址：</strong>北京市朝阳区望京东路8号锐创国际中心2号楼510室<br />
						  <strong>电话：</strong>010-84730103<br />
					    <strong>传真：</strong>010-84730132</td>
						<td class=f1 valign=top align=right bgcolor=#ffffff>费率以银行为准</td>
					</tr>
				<!--	
					<tr>
					  <td valign=top bgcolor=#ffffff><input type="radio" value="3" name="payType" iscod="0" /></td>
					  <td valign=top bgcolor=#ffffff><strong>货到付款</strong></td>
					  <td valign=top bgcolor=#ffffff>&nbsp;</td>
					  <td class=f1 valign=top align=right bgcolor=#ffffff>&nbsp;</td>
				  </tr>
				  -->
				</tbody>
		  </table>
			
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">其它信息</span>
			</div>
			<table class=floattable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0>
				<tbody>
					<tr>
						<td rowspan="2" valign=top bgcolor=#ffffff><strong>订单附言:</strong></td>
						<td bgcolor=#ffffff><textarea class=inputborder id=remark name=remark rows=3 cols=60></textarea></td>
					</tr>
					
				</tbody>
			</table>
	<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle">开票信息&nbsp;&nbsp;普通发票只需要填公司名称</span>
		  </div>
<table class=floattable cellspacing=1 cellpadding=5 width="100%" align=center bgcolor=#e3e3e3 border=0 id="zzjs_net" >
			
					<tr>
						<td width="33%" align="right" bgcolor=#ffffff>公司名称：</td>
					    <td valign=top bgcolor=#ffffff><input name="invoice[company]" type="text" id="invoice[company]"  style="border:1px  solid #7F9DB9; width:230px;"/></td>
					</tr>
					<tr>
					  <td align="right" valign=top bgcolor=#ffffff>纳税人识别号：</td>
	                  <td valign=top bgcolor=#ffffff><input name="invoice[taxpayer]" type="text" id="invoice[company]"  style="border:1px  solid #7F9DB9; width:230px;"/></td>
		</tr>
					<tr>
					  <td align="right" valign=top bgcolor=#ffffff>地址：</td>
	                  <td valign=top bgcolor=#ffffff><input name="invoice[address]" type="text" id="invoice[company]"  style="border:1px  solid #7F9DB9; width:230px;"/></td>
		</tr>
					<tr>
					  <td align="right" valign=top bgcolor=#ffffff>电话：</td>
	                  <td valign=top bgcolor=#ffffff><input name="invoice[phone]" type="text" id="invoice[company]"  style="border:1px  solid #7F9DB9; width:230px;"/></td>
		</tr>
					<tr>
					  <td align="right" valign=top bgcolor=#ffffff>开户行及帐号：</td>
	                  <td valign=top bgcolor=#ffffff><input name="invoice[bank]" type="text" id="invoice[company]"  style="border:1px  solid #7F9DB9; width:230px;"/></td>
		</tr>
			</table>
		 
			<div style="margin-top:20px; border-top:2px #009900 solid">
				<span class="boldTitle" style="float:right">费用总计</span>
		  </div>
			<div id=ecs_ordertotal>
				<table cellspacing=1 cellpadding=5 width="100%" align=center border=0 style="clear:both">
					<tbody>
						<tr>
							<td align=right bgcolor=#ffffff>商品总价: <font style="color:#FE6500; font-weight:bold">￥{$CartArr[totalPrice]}元</font> </td>
						</tr>
						<tr>
							<td align=right bgcolor=#ffffff>应付款金额: <font style="color:#FE6500; font-weight:bold">￥{$CartArr[totalPrice]}元</font> </td>
						</tr>
					</tbody>
				</table>
			</div>
			
			<div style="margin: 8px auto" align=center>
			<input type="hidden" name="totalPrice" value="{$CartArr[totalPrice]}" />
				<input type=image src="{GODHOUSE_DOMAIN_IMAGE}images/default/bnt_suborder.gif"> 
				<input type=hidden value=done name=step> 
			</div>
		</form>
	</div>
</div>
<div class="top_3"></div>
{template footer}